Skip to content

Conversation

topper-123
Copy link
Contributor

@topper-123 topper-123 commented Jun 6, 2018

Currently, membership checks in CategoricalIndex is very slow as explained in #21022. This PR fixes the issue for CategoricalIndex, while #21022 contains the fix for Categorical. The difference between the two cases is the use of _engine for CategoricalIndex, which makes this even faster than the Catagorical solution in #21022.

Tests exist already and can be found in tests/indexes/test_category.py::TestCategoricalIndex::test_contains.

ASV:

      before           after         ratio
     [0c65c57a]       [986779ab]
-      2.49±0.2ms       3.26±0.2μs     0.00  categoricals.Contains.time_contains

SOME BENCHMARKS HAVE CHANGED SIGNIFICANTLY.

@topper-123 topper-123 force-pushed the CategoricalIndex.__contains__ branch from aa6bd38 to a07d5fc Compare June 6, 2018 18:53
@topper-123 topper-123 closed this Jun 6, 2018
@topper-123 topper-123 reopened this Jun 7, 2018
@topper-123 topper-123 closed this Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant